import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/dashboard'
    },
    {
      path: '/',
      meta: {title: '布局'},
      component: resolve => require(['./components/Home'], resolve),
      children: [
        {
          path: '/dashboard',
          meta: {title: '系统首页'},
          component: resolve => require(['./views/Dashboard'], resolve)
        },
        {
          path: '/table',
          meta: {title: '基础表格'},
          component: resolve => require(['./views/Table'], resolve)
        },
        {
          path: '/basic-form',
          meta: {title: '基础表单'},
          component: resolve => require(['./views/form/BasicForm'], resolve)
        },
        {
          path: '/file-upload',
          meta: {title: '文件上传'},
          component: resolve => require(['./views/form/FileUpload'], resolve)
        },
        {
          path: '/editor',
          meta: {title: '富文本编辑器'},
          component: resolve => require(['./views/form/Editor'], resolve)
        },
        {
          path: '/notice',
          meta: {title: '消息中心'},
          component: resolve => require(['./views/Notice'], resolve)
        }
      ]
    },
    {
      path: '/login',
      meta: {title: '登录'},
      component: resolve => require(['./views/Login'], resolve)
    }
  ]
})
